package homework.four;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class Demo4 {



        public static void main(String[] args) {

            String filePath = "output.txt";

            try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath))) {

                writer.write("我喜欢唱跳rap篮球!");
                writer.newLine();
                writer.write("我");
                writer.newLine();
                writer.write("is 天才!");


                writer.flush();

                System.out.println("数据已成功写入文件");
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

